package com.shreecon.lms.interfaces.persistance;

import com.shreecon.lms.interfaces.IMessageConstant;
import com.shreecon.lms.interfaces.LMSException;

public class LeaveDAOFactory {


    /** The Constant _instance. */
	private static final LeaveDAOFactory _instance = new LeaveDAOFactory();
	
	/**
     * Instantiates a new employee dao factory.
     */
	private LeaveDAOFactory() {
		
	}
	
	/**
     * Gets the single instance of LeaveDAOFactory.
     * 
     * @return single instance of LeaveDAOFactory
     */
	public static final LeaveDAOFactory getInstance() {
		return _instance;
	}
	
	/**
     * Gets the employee dao.
     * 
     * @return the employee dao
     * @throws LMSException
     *             the lMS exception
     */
	public ILeaveDAO getLeaveDAO() throws LMSException {
		try {
			return (ILeaveDAO)Class.forName("com.shreecon.lms.persistancy.LeaveDAO").newInstance();
		} catch (InstantiationException e) {
			e.printStackTrace();
			throw new LMSException(IMessageConstant.TECH_ERROR, e);
		} catch (IllegalAccessException e) {
			e.printStackTrace();
			throw new LMSException(IMessageConstant.TECH_ERROR, e);
		} catch (ClassNotFoundException e) {
			e.printStackTrace();
			throw new LMSException(IMessageConstant.TECH_ERROR, e);
		}
	}


}
